<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>登录</title>
	<link rel="stylesheet" type="text/css" href="/wjfh/css/common.css"/>
	<link rel="stylesheet" type="text/css" href="/wjfh/layui/css/layui.css"/>
	<link rel="stylesheet" type="text/css" href="/wjfh/css/style.css"/>
	<script src="/wjfh/js/flexible.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>

	<form class="layui-form" method="post" id="loginBox">
		<div class="resgcontain" >
			<h1 class="site-h1">欢迎登录 — </h1>
			<!-- <div class="logobox"><img src="img/logo.png" ></div> -->
			<div class="item">
				<input type="text" name="username"  class="publicIptSty widthman" value="" id="username" placeholder="手机号" required lay-verify="required" v-model="username"/>
			</div>
			<div class="item">
				<input type="password" name="password"  class="publicIptSty widthman" value="" id="password" placeholder="密码" required lay-verify="required" v-model="password"/>
			</div>
		</div>
		<div class="shangpd">
			<button class="layui-btn layui-btn-fluid resgSubmit" onclick="userLogin()" lay-submit lay-filter="lgSubmit">登录</button>
		</div>
		</form>
	<div class="Noresg">没有账号？<a href="">立即注册</a></div>
	<script src="/wjfh/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="/wjfh/js/vue.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="/wjfh/js/axios.js" type="text/javascript" charset="utf-8"></script>
	<script src="/js/jquery.min.js"></script>
	<script>


		
		function userLogin() {
            $.post("/loginOutVerify",{"username":$("#username").val(),"password":$("#password").val()},function (res) {
                console.log(res);
                alert(res);
                if(res.code==0){
					alert(res.code)
                    window.location.href = '/goodsManager/page/index';
				}
            },'json')
        }

//        layui.use(['jquery', 'form','layer'], function() {
//            $ = layui.jquery,
//                form = layui.form,
//                layer = layui.layer;
//            form.on('submit(lgSubmit)',function(data){
//                console.log(data);
//                $.post("/loginOutVerify",{"username":$("#username").val(),"password":$("#password").val()},function (res) {
//                    console.log(res);
//                })
//			})
//		});


         //登录测试


//		var login = new  Vue({
//			el:"#loginBox",
//			data:{
//                username:'',
//                password:''
//			},
//			methods:{
//			  LoginFun:function () {
//
//              }
//			},
//			mounted:function () {
//                layui.use(['jquery', 'form','layer'], function() {
//                    $ = layui.jquery,
//					form = layui.form,
//					layer = layui.layer;
//                    form.on('submit(lgSubmit)', function(data){
//                        $.ajax({
//
//                            type: "POST",
//                            url: "/loginOutVerify",
//                            data: {
//								username:$('#username').val(),
//                                password:$('#password').val()
//							},
//                            error: function(request) {
//                                layer.alert("Connection error");
//                            },
//                            success: function(data) {
//                                console.log(data);
//                            }
//                        });
////					   axios.post('/loginOutVerify', {
////							params:{
////								username:login.username,
////								password:login.password,
////							},
////							dataType: 'json', //服务器返回json格式数据 你有毒 Termianl
////							type: 'post', //HTTP请求类型
////						})
////						.then(function(response) {
////
////							console.log(response);
////							if(response.data.code == 0){
////								layer.msg('登录成功！', {time: 1200},function () {
////									window.location.href='/goodsManager/page/index';
////								});
////
////							}else{
////								layer.msg(data.msg, {time: 1200});
////							}
////
////						})
////						.catch(function (error) {
////							//layer.msg(error)
////						});
//                        return false;
//					})
//				})
//            }
//		})
	</script>
</body>
</html>
